﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using CSF.BusinessCore.Data;

namespace CSF.Products.Data
{
    public enum ProductOptionQtyRule
    {
        /// <summary>
        /// 等于订购的产品的数量
        /// </summary>
        ByOrdering = 0,
        /// <summary>
        /// 用户自由添加
        /// </summary>
        ByUserAdd = 1,
        /// <summary>
        /// 根据产品的某个量度数据为基准
        /// </summary>
        ByMeasure = 2,
        /// <summary>
        /// 根据产品形状的边数量为基准
        /// </summary>
        BySideCount = 3,
        /// <summary>
        /// 根据产品形状的角数量为基准
        /// </summary>
        ByCornerCount = 4,
        /// <summary>
        /// 根据用户输入的数字
        /// </summary>
        ByUserInputDigit = 5,
        /// <summary>
        /// 根据用户输入的字符串长度
        /// </summary>
        ByUserInputLength = 6,

    }

    public class ProductOptionUse : Transaction
    {
        /// <summary>
        /// 依赖项Id
        /// </summary>
        public int MasterId { get; set; }

        /// <summary>
        /// 数量规则
        /// </summary>
        public ProductOptionQtyRule QtyRule { get; set; }

        /// <summary>
        /// 数量因子，在数量规则基础上的倍数
        /// </summary>
        public decimal QtyFactor { get; set; }

        /// <summary>
        /// 作为一个option时，在原价格基础上打折
        /// </summary>
        public decimal OptionDiscount { get; set; }

        /// <summary>
        /// 数量依赖的测量参数id
        /// </summary>
        public int QtyMeasureParamId { get; set; }
    }
}
